package tur.br.moradadosol.control;

import tur.br.moradadosol.util.Conf;

/**
 * Servlet implementation class for Servlet: InitConfigServlet
 */
 public class InitConfigServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
	
	private static final long serialVersionUID = 1L;

	/* (non-Java-doc)
	 * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	public void init() {
		
		String p = this.getServletContext().getRealPath("/");
		if(!p.endsWith("/")) {
			p += "/";
		}
		
		p += this.getInitParameter("configPath");
		if(!p.endsWith("/")) {
			p += "/";
		}
		
		p += this.getInitParameter("configFile");
		
		new Conf(p);
		
		try {
			System.out.println("configPath: " + Conf.getProp("configPath"));
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	
	
}